import React from "react";

export default class LearnLife3 extends React.Component {
  state = {
    obj: {
      name: "张三",
    },
  };

  render() {
    return (
      <div>
        <div>错误的组件 - {this.state.obj.name}</div>
        <button
          onClick={() =>
            this.setState({
              obj: null,
            })
          }
        >
          触发错误
        </button>
      </div>
    );
  }
}
